{include file="/wap/public/top" /}
{include file="/wap/public/layui" /}

<link rel="stylesheet" type="text/css" href="__indexwap__/css/userf.css">
<div class="user_zx_right">
<div class="box">
<div class="tagMenu">
<ul class="menu">
<li class="current"><a href="{:url('user/msg')}">站内短信</a></li>
<li><a href="{:url('user/memberlog')}">登录记录</a></li>
</ul>
<div class="hite"> <span id="account"></span> </div>
</div>
</div>
<div class="myinfo" style="padding: 20px; margin-bottom: 15px;background:#fff;">
<p style="margin:15px 0px;width:100%">尊敬的{$config.title}会员，以下是您在{$config.title}的站内短信，敬请审阅！</p>

<div class="container-fluid">
        <div class="row-fluid">
            <table class="datatable table table-striped table-bordered table-hover  dataTable" id="DataTables_Table_0">
                <thead>
                    <tr>
                        <th class="sorting_desc"><img src="__indexwap__/images/xf1.jpg"></th>
                        <th class="sorting">标题</th>
                        <th class="sorting">时间</th>
                        <th class="sorting">状态</th>
                        <th class="sorting">删除</th>
                    </tr>
                </thead>
                <tbody role="alert" aria-live="polite" aria-relevant="all">
				{volist name="new" id="vo"}
					                    <tr class="gradeX" onclick="$('#sms{$vo.id},#msg{$vo.id}').slideToggle(2);{php}if($vo['stater']!='1'){echo "user_msg(".$vo['id'].",1);";}{/php}">
                        <td class=" ">{$vo.id}</td>
                        <td class=" "><img src="__indexwap__/images/{$vo.stater|msgpic=###}.jpg"> {$vo.title}						
				<div height="34" style="display:none; width: 98%; height: auto; font-size: 12px; border: 1px dashed rgb(217, 38, 15); padding: 10px;margin: 10px 0 10px 0;  
    background-color:#fffcfa;" id="sms{$vo.id}">
						<div style="width:100%; display:none;" id="msg{$vo.id}">{$vo.content}</div>
						</div>
						</td>
                       <td class=" ">{$vo.addtime}</td>
                        <td class="center " id="zt{$vo.id}">{$vo.stater|msgstater=###}</td>
                        <td class="center " id="del{$vo.id}"><a onclick="user_msg({$vo.id},2);">删除</a></td>
                    </tr>
                   {/volist}
                          
                   
                                    </tbody>
            </table>
<div class="page"> {$new->render()}   </div>
        </div>
		
    </div> 

</div>
</div>


<script>

 

         
			
       

		function user_msg(id,type){
               
                    $.ajax({
                        async:false,
                        url:"{:url('user/msg')}",
                        data:{'id':id,'type':type},
                        type:'post',
                        dataType:'json',
                        success:function(res){
							console.log(res);
                            if(res.status != 1){
                                msg(res.msg);
                              
                               
                                
                            }else{
								// msg(res.msg);
								if(res.sx=='1' && type=='1'){
									$("#zt"+id).html(res.html);
								  //window.location.reload();
								  }
								  if(type=='2'){
									   msg(res.msg);
								  setTimeout(function(){window.location.reload();},2000);
								  }
								
                             
                            }
							if(res.url){
							setTimeout(function(){window.location.href=res.url},2000);
							}
							return false;
                        },
                        error : function(XMLHttpRequest, textStatus, errorThrown) {
							console.log(textStatus);
							  msg('网络失败，请刷新页面后重试!');
                           
                        }
                    });
               
            }
</script>
{include file="/wap/public/hder" /}